package com.freesky.common.utils.reponse;

public class ConcreteJSONResponseBuilder implements JSONResponseBuilder {
    private JSONResponse response;

    public ConcreteJSONResponseBuilder() {
        this.response = new JSONResponse();
    }
    @Override
    public JSONResponseBuilder code(int code) {
        response.setCode(code);
        return this;
    }

    @Override
    public JSONResponseBuilder msg(String msg) {
        response.setMsg(msg);
        return this;
    }

    @Override
    public JSONResponseBuilder object(Object data) {
        response.setData(data);
        return this;
    }

    @Override
    public JSONResponse build() {
        return response;
    }
}
